public class WaitMain {
    public static void main(String[] args) throws InterruptedException {
        Object object = new Object();
Thread t1 = new Thread(new WaitTask(object));
Thread t2 = new Thread(new WaitTask(object));
Thread t3 = new Thread(new WaitTask(object));
Thread t4 = new Thread(new NotifyAll(object));
t1.start();
t2.start();
t3.start();
Thread.sleep(1000);
t4.start();
    }
}
